#!usr/bin/env python  
# -*- coding:utf-8 _*-
""" 
@author:robot
@file: case_data_twice_op.py 
@version:
@time: 2022/08/18 
"""
import copy


# 获取案例数据
def get_case_data(data, dag):
    data = data.get('generateCase').get(dag)
    return copy.deepcopy(data)


# 更新任务名前后缀
def task_update_dataflow_name(data, prefix='', suffix=''):
    name = data.get('task_config').get('config').get('name')
    new_name = f'{prefix}{name}{suffix}'
    data['task_config']['config'].update({'name': new_name})
    return data


# 更新 任务 setting
def task_update_setting(data, update):
    data['task_config']['config'].update(update)
    return data


# table generate get
def get_generate_data(data):
    return data.get('generateTable')
